# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
# Contributor: Armin K. <krejzi at email dot com>

pkgname=ocaml-ctypes
pkgver=0.20.2
pkgrel=1
pkgdesc="Library for binding to C libraries using pure OCaml"
arch=('loong64' 'x86_64')
url="https://github.com/ocamllabs/ocaml-ctypes"
license=('MIT')
depends=('ocaml' 'libffi' 'ocaml-integers' 'ocaml-bigarray-compat')
makedepends=('ocaml-findlib' 'ocaml-compiler-libs')
options=('!strip' '!makeflags')
source=($pkgname-$pkgver.tar.gz::https://github.com/ocamllabs/ocaml-ctypes/archive/$pkgver.tar.gz)
sha512sums=('99cdc77e5283b26fb8f00376f9fe87f84809f533544409036c622ef3bdeb4b6640ece1976da4ef5f4e7dff0ab5a8dd2994ea939fb8a2832d22579b8e854ee55e')

build() {
  cd "$srcdir/$pkgname-$pkgver"
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  local _destdir="$pkgdir$(ocamlfind printconf destdir)"
  install -d "$_destdir/stublibs"

  make OCAMLFIND_DESTDIR="$_destdir" install

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim:set ts=2 sw=2 et:
